<template>
  <view class="container">
    <!-- 英雄区域 -->
    <view class="hero-section">
      <view class="hero-content">
        <text class="hero-title">EchoRealm</text>
        <text class="hero-subtitle">沉浸式TRPG在线平台</text>
        <text class="hero-description">
          体验最真实的桌面角色扮演游戏，支持经典模式和现代TRPG模式，
          内置地图编辑器、角色卡系统、骰娘助手等完整功能。
        </text>
        <view class="hero-actions">
          <button class="btn-primary" @click="goToClassic">开始游戏</button>
          <button class="btn-secondary" @click="goToTRPG">创建模组</button>
        </view>
      </view>
    </view>

    <!-- 功能特色 -->
    <view class="features-section">
      <text class="section-title">平台特色</text>
      <view class="features-grid">
        <view class="feature-item" v-for="(feature, index) in features" :key="index">
          <text class="feature-icon">{{ feature.icon }}</text>
          <text class="feature-title">{{ feature.title }}</text>
          <text class="feature-desc">{{ feature.description }}</text>
        </view>
      </view>
    </view>

    <!-- 快速开始 -->
    <view class="quick-start-section">
      <text class="section-title">快速开始</text>
      <view class="steps">
        <view class="step" v-for="(step, index) in steps" :key="index">
          <view class="step-number">{{ index + 1 }}</view>
          <view class="step-content">
            <text class="step-title">{{ step.title }}</text>
            <text class="step-desc">{{ step.description }}</text>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script setup>
import { ref } from 'vue'

// 功能特色数据
const features = ref([
  {
    icon: '📱',
    title: '多端适配',
    description: '支持PC端和移动端，响应式设计确保最佳体验'
  },
  {
    icon: '⚡',
    title: '实时同步',
    description: 'WebSocket技术实现游戏状态实时同步'
  },
  {
    icon: '🎨',
    title: '模组编辑器',
    description: '可视化模组创建工具，支持自定义剧情'
  },
  {
    icon: '🔒',
    title: '安全可靠',
    description: 'JWT身份验证，数据加密存储'
  }
])

// 快速开始步骤
const steps = ref([
  {
    title: '注册账号',
    description: '创建您的EchoRealm账号'
  },
  {
    title: '创建角色',
    description: '使用COC7规则创建角色卡'
  },
  {
    title: '开始游戏',
    description: '加入房间或创建自己的游戏'
  }
])

// 方法
const goToClassic = () => {
  uni.switchTab({
    url: '/pages/classic/classic'
  })
}

const goToTRPG = () => {
  uni.switchTab({
    url: '/pages/trpg/trpg'
  })
}
</script>

<style scoped>
.container {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.hero-section {
  padding: 60rpx 40rpx;
  text-align: center;
  color: white;
}

.hero-content {
  max-width: 600rpx;
  margin: 0 auto;
}

.hero-title {
  display: block;
  font-size: 80rpx;
  font-weight: bold;
  margin-bottom: 20rpx;
  background: linear-gradient(45deg, #fff, #e0e7ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  display: block;
  font-size: 36rpx;
  margin-bottom: 30rpx;
  opacity: 0.9;
}

.hero-description {
  display: block;
  font-size: 28rpx;
  line-height: 1.6;
  margin-bottom: 60rpx;
  opacity: 0.8;
}

.hero-actions {
  display: flex;
  gap: 20rpx;
  justify-content: center;
}

.btn-primary, .btn-secondary {
  padding: 20rpx 40rpx;
  border-radius: 50rpx;
  font-size: 28rpx;
  font-weight: bold;
  border: none;
}

.btn-primary {
  background: white;
  color: #667eea;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2rpx solid white;
}

.features-section {
  padding: 80rpx 40rpx;
  background: white;
}

.section-title {
  display: block;
  text-align: center;
  font-size: 48rpx;
  font-weight: bold;
  margin-bottom: 60rpx;
  color: #333;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40rpx;
}

.feature-item {
  text-align: center;
  padding: 40rpx 20rpx;
}

.feature-icon {
  display: block;
  font-size: 80rpx;
  margin-bottom: 20rpx;
}

.feature-title {
  display: block;
  font-size: 32rpx;
  font-weight: bold;
  margin-bottom: 15rpx;
  color: #333;
}

.feature-desc {
  display: block;
  font-size: 24rpx;
  color: #666;
  line-height: 1.6;
}

.quick-start-section {
  padding: 80rpx 40rpx;
  background: #f8fafc;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 40rpx;
  max-width: 600rpx;
  margin: 0 auto;
}

.step {
  display: flex;
  align-items: center;
  gap: 30rpx;
}

.step-number {
  width: 80rpx;
  height: 80rpx;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36rpx;
  font-weight: bold;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-title {
  display: block;
  font-size: 32rpx;
  font-weight: bold;
  margin-bottom: 10rpx;
  color: #333;
}

.step-desc {
  display: block;
  font-size: 24rpx;
  color: #666;
}
</style>
